# heading ----
message(paste0("Description: ", "function to set the theme of graphics"),
        "\n",
        paste0("Author: ", "Cedric Chambru (Department of Economics, University of Zurich)"),
        "\n",
        paste0("Last update: ", "07 June 2023"),
        "\n",
        paste0("List of functions: ", "labs_plot, theme_bar_plot"))


# function: labs_plot ----
labs_plot <- function(...){
	ggplot2::labs(
    	title = title_plot,
    	subtitle = subtitle_plot,
    	caption = caption_plot,
    	y = y_plot,
    	x = x_plot
    )
}


# function: theme_bar_plot ----
theme_bar_plot <- function(...){
    ggplot2::theme(
    	text = ggplot2::element_text(
    		family = "UbuntuRegular",
    		colour = "black"
    		),
    	# background colours
    	plot.background = ggplot2::element_rect(
    		fill = "white",
    		colour = NA
    		),
    	panel.background = ggplot2::element_rect(
    		fill = "white",
    		colour = NA
    		),
    	legend.background = ggplot2::element_rect(
    		fill = "white",
    		colour = NA
    		),
    	# panel
    	panel.grid.major = ggplot2::element_line(
    		linewidth = 0.25,
    		colour = "grey",
    		),
    	panel.grid.minor = ggplot2::element_blank(),
    	axis.line = ggplot2::element_line(
    		linewidth = 1,
    		colour = "black"
    		),
    	# axis
    	axis.text = ggplot2::element_text(
    		size = 40,
    		colour = "black"
    		),
    	axis.title.x = ggplot2::element_text(
    		size = 40,
    		colour = "black",
    		margin = margin(t = 22)
    		),
    	axis.title.y = ggplot2::element_text(
    		size = 40,
    		colour = "black",
    		margin = margin(r = 22)
    		),
    	# margins
    	plot.margin = grid::unit(
    		x = c(1,1,1,1),
    		units = "cm"
    		),
    	panel.spacing = grid::unit(
    		x = c(1.5,1.5,1.5,1.5),
    		units = "cm"
    		),
    	panel.border = ggplot2::element_blank()
    	)
}

